package com.kexio.enterprise.integration.event.query;

import com.kexio.enterprise.integration.event.enums.EventPriority;
import com.kexio.enterprise.integration.event.enums.EventStatus;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 事件查询条件
 * 
 * @author Kexio
 * @since 1.0.0
 */
public class EventQueryCriteria {
    private List<String> eventTypes;
    private List<String> eventIds;
    private List<String> sources;
    private List<String> topics;
    private List<EventPriority> priorities;
    private List<EventStatus> statuses;
    private LocalDateTime startTime;
    private LocalDateTime endTime;
    private String correlationId;
    private String aggregateId;
    private String aggregateType;
    private int limit;
    private int offset;
    private String sortBy;
    private boolean ascending;

    public EventQueryCriteria() {
        this.limit = 100;
        this.offset = 0;
        this.sortBy = "timestamp";
        this.ascending = false; // 默认降序，最新的在前
    }

    // Getters and Setters
    public List<String> getEventTypes() { return eventTypes; }
    public void setEventTypes(List<String> eventTypes) { this.eventTypes = eventTypes; }
    
    public List<String> getEventIds() { return eventIds; }
    public void setEventIds(List<String> eventIds) { this.eventIds = eventIds; }
    
    public List<String> getSources() { return sources; }
    public void setSources(List<String> sources) { this.sources = sources; }
    
    public List<String> getTopics() { return topics; }
    public void setTopics(List<String> topics) { this.topics = topics; }
    
    public List<EventPriority> getPriorities() { return priorities; }
    public void setPriorities(List<EventPriority> priorities) { this.priorities = priorities; }
    
    public List<EventStatus> getStatuses() { return statuses; }
    public void setStatuses(List<EventStatus> statuses) { this.statuses = statuses; }
    
    public LocalDateTime getStartTime() { return startTime; }
    public void setStartTime(LocalDateTime startTime) { this.startTime = startTime; }
    
    public LocalDateTime getEndTime() { return endTime; }
    public void setEndTime(LocalDateTime endTime) { this.endTime = endTime; }
    
    public String getCorrelationId() { return correlationId; }
    public void setCorrelationId(String correlationId) { this.correlationId = correlationId; }
    
    public String getAggregateId() { return aggregateId; }
    public void setAggregateId(String aggregateId) { this.aggregateId = aggregateId; }
    
    public String getAggregateType() { return aggregateType; }
    public void setAggregateType(String aggregateType) { this.aggregateType = aggregateType; }
    
    public int getLimit() { return limit; }
    public void setLimit(int limit) { this.limit = limit; }
    
    public int getOffset() { return offset; }
    public void setOffset(int offset) { this.offset = offset; }
    
    public String getSortBy() { return sortBy; }
    public void setSortBy(String sortBy) { this.sortBy = sortBy; }
    
    public boolean isAscending() { return ascending; }
    public void setAscending(boolean ascending) { this.ascending = ascending; }
}
